#ifndef TOP_MARK_OBJECT_H
#define TOP_MARK_OBJECT_H

#include "LabelObject.h"
#include "TopMarkType.h"
#include "ValueType.h"

#include <object_v2/object_v2.h>

OBJECT_DECLARE (TopMarkObject, top_mark_object)
#define TOP_MARK_OBJECT(any) ((TopMarkObject*)(any))
struct _TopMarkObject
{
        ObjectNode    parent_instance;
        ObjectString* top_mark_name;
        ObjectHash* label_table; /* 仅用于存储本 TopMark 下的所有 Label 名称和
                                    ValueType */
        LabelObject* label_head;
        TopMarkType  type;
};

/**
 * @brief 注册一组 LabelObject 键值类型到 TopMarkObject。
 * @param label_key_name 键名称，如 Student、Name 等
 * @param type 键类型
 */
void top_mark_object_register (TopMarkObject* obj,
                               const char*    label_key_name,
                               ValueType      type);
/**
 * @brief 接收一行 KeyValue 并解析为对应的 Label 对象
 * @param kvline 一行 KeyValue 的 StringApplication 对象
 * @return 0:解析成功  1:出错
 */
int  top_mark_object_analysis_keyvalue_line (TopMarkObject*           obj,
                                             ObjectStringApplication* kvline);

void top_mark_object_register_as_school_time_table (TopMarkObject* obj);
void top_mark_object_register_as_student_info (TopMarkObject* obj);
void top_mark_object_register_as_course_info (TopMarkObject* obj);

#endif